<?php
use think\facade\Route;

//登录页面
Route::rule('login','Login/login','GET|POST');
//验证码
Route::get('captcha','Login/captcha');
// 退出登录
Route::get('logout', 'Login/logout');
// 后台首页
Route::get('index', 'Index/index')->middleware(\app\middleware\Login::class);
// 首页欢迎页面
Route::get('welcome', 'Index/welcome')->middleware(\app\middleware\Login::class);
// 幻灯片资源路由
Route::resource('swiper', 'Swiper')->middleware(\app\middleware\Login::class);
//图片上传
Route::post('swiper/upload', 'Swiper/upload')->middleware(\app\middleware\Login::class);
// 获取幻灯片详情getSwipers
Route::get('swiper/index/get_swiper', 'Swiper/getSwiper')->middleware(\app\middleware\Login::class);
//修改幻灯片的显示状态
Route::post('swiper/index/is_show', 'Swiper/isShow')->middleware(\app\middleware\Login::class);

//商品管理
Route::resource('category', 'Category')->middleware(\app\middleware\Login::class);
// 获取幻灯片详情getSwipers
Route::get('category/index/get_cats', 'Category/getcats')->middleware(\app\middleware\Login::class);
Route::resource('goods', 'Goods')->middleware(\app\middleware\Login::class);